﻿namespace KeRui.Common
{
    using System;
    using System.Runtime.InteropServices;

    public class CNDate
    {
        private string[] ConstellationName;
        private const ushort END_YEAR = 0x802;
        private byte[] gLunarHolDay;
        private byte[] gLunarMonth;
        private int[] gLunarMonthDay;
        private string[] LunarHolDayName;
        private DateTime m_Date;
        private const ushort START_YEAR = 0x76d;

        public CNDate()
        {
            this.ConstellationName = new string[] { "白羊座", "金牛座", "双子座", "巨蟹座", "狮子座", "处女座", "天秤座", "天蝎座", "射手座", "摩羯座", "水瓶座", "双鱼座" };
            this.LunarHolDayName = new string[] { 
                "小寒", "大寒", "立春", "雨水", "惊蛰", "春分", "清明", "谷雨", "立夏", "小满", "芒种", "夏至", "小暑", "大暑", "立秋", "处暑", 
                "白露", "秋分", "寒露", "霜降", "立冬", "小雪", "大雪", "冬至"
             };
            this.gLunarMonthDay = new int[] { 
                0x4ae0, 0xa570, 0x5268, 0xd260, 0xd950, 0x6aa8, 0x56a0, 0x9ad0, 0x4ae8, 0x4ae0, 0xa4d8, 0xa4d0, 0xd250, 0xd548, 0xb550, 0x56a0, 
                0x96d0, 0x95b0, 0x49b8, 0x49b0, 0xa4b0, 0xb258, 0x6a50, 0x6d40, 0xada8, 0x2b60, 0x9570, 0x4978, 0x4970, 0x64b0, 0xd4a0, 0xea50, 
                0x6d48, 0x5ad0, 0x2b60, 0x9370, 0x92e0, 0xc968, 0xc950, 0xd4a0, 0xda50, 0xb550, 0x56a0, 0xaad8, 0x25d0, 0x92d0, 0xc958, 0xa950, 
                0xb4a8, 0x6ca0, 0xb550, 0x55a8, 0x4da0, 0xa5b0, 0x52b8, 0x52b0, 0xa950, 0xe950, 0x6aa0, 0xad50, 0xab50, 0x4b60, 0xa570, 0xa570, 
                0x5260, 0xe930, 0xd950, 0x5aa8, 0x56a0, 0x96d0, 0x4ae8, 0x4ad0, 0xa4d0, 0xd268, 0xd250, 0xd528, 0xb540, 0xb6a0, 0x96d0, 0x95b0, 
                0x49b0, 0xa4b8, 0xa4b0, 0xb258, 0x6a50, 0x6d40, 0xada0, 0xab60, 0x9370, 0x4978, 0x4970, 0x64b0, 0x6a50, 0xea50, 0x6b28, 0x5ac0, 
                0xab60, 0x9368, 0x92e0, 0xc960, 0xd4a8, 0xd4a0, 0xda50, 0x5aa8, 0x56a0, 0xaad8, 0x25d0, 0x92d0, 0xc958, 0xa950, 0xb4a0, 0xb550, 
                0xb550, 0x55a8, 0x4ba0, 0xa5b0, 0x52b8, 0x52b0, 0xa930, 0x74a8, 0x6aa0, 0xad50, 0x4da8, 0x4b60, 0x9570, 0xa4e0, 0xd260, 0xe930, 
                0xd530, 0x5aa0, 0x6b50, 0x96d0, 0x4ae8, 0x4ad0, 0xa4d0, 0xd258, 0xd250, 0xd520, 0xdaa0, 0xb5a0, 0x56d0, 0x4ad8, 0x49b0, 0xa4b8, 
                0xa4b0, 0xaa50, 0xb528, 0x6d20, 0xada0, 0x55b0
             };
            this.gLunarMonth = new byte[] { 
                0, 80, 4, 0, 0x20, 0x60, 5, 0, 0x20, 0x70, 5, 0, 0x40, 2, 6, 0, 
                80, 3, 7, 0, 0x60, 4, 0, 0x20, 0x70, 5, 0, 0x30, 0x80, 6, 0, 0x40, 
                3, 7, 0, 80, 4, 8, 0, 0x60, 4, 10, 0, 0x60, 5, 0, 0x30, 0x80, 
                5, 0, 0x40, 2, 7, 0, 80, 4, 9, 0, 0x60, 4, 0, 0x20, 0x60, 5, 
                0, 0x30, 0xb0, 6, 0, 80, 2, 7, 0, 80, 3
             };
            this.gLunarHolDay = new byte[] { 
                150, 180, 150, 0xa6, 0x97, 0x97, 120, 0x79, 0x79, 0x69, 120, 0x77, 150, 0xa4, 150, 150, 
                0x97, 0x87, 0x79, 0x79, 0x79, 0x69, 120, 120, 150, 0xa5, 0x87, 150, 0x87, 0x87, 0x79, 0x69, 
                0x69, 0x69, 120, 120, 0x86, 0xa5, 150, 0xa5, 150, 0x97, 0x88, 120, 120, 0x79, 120, 0x87, 
                150, 180, 150, 0xa6, 0x97, 0x97, 120, 0x79, 0x79, 0x69, 120, 0x77, 150, 0xa4, 150, 150, 
                0x97, 0x97, 0x79, 0x79, 0x79, 0x69, 120, 120, 150, 0xa5, 0x87, 150, 0x87, 0x87, 0x79, 0x69, 
                0x69, 0x69, 120, 120, 0x86, 0xa5, 150, 0xa5, 150, 0x97, 0x88, 120, 120, 0x69, 120, 0x87, 
                150, 180, 150, 0xa6, 0x97, 0x97, 120, 0x79, 0x79, 0x69, 120, 0x77, 150, 0xa4, 150, 150, 
                0x97, 0x97, 0x79, 0x79, 0x79, 0x69, 120, 120, 150, 0xa5, 0x87, 150, 0x87, 0x87, 0x79, 0x69, 
                0x69, 0x69, 120, 120, 0x86, 0xa5, 150, 0xa5, 150, 0x97, 0x88, 120, 120, 0x69, 120, 0x87, 
                0x95, 180, 150, 0xa6, 0x97, 0x97, 120, 0x79, 0x79, 0x69, 120, 0x77, 150, 180, 150, 0xa6, 
                0x97, 0x97, 0x79, 0x79, 0x79, 0x69, 120, 120, 150, 0xa5, 0x97, 150, 0x97, 0x87, 0x79, 0x79, 
                0x69, 0x69, 120, 120, 150, 0xa5, 150, 0xa5, 150, 0x97, 0x88, 120, 120, 0x79, 0x77, 0x87, 
                0x95, 180, 150, 0xa6, 150, 0x97, 120, 0x79, 120, 0x69, 120, 0x87, 150, 180, 150, 0xa6, 
                0x97, 0x97, 0x79, 0x79, 0x79, 0x69, 120, 0x77, 150, 0xa5, 0x97, 150, 0x97, 0x87, 0x79, 0x79, 
                0x69, 0x69, 120, 120, 150, 0xa5, 150, 0xa5, 150, 0x97, 0x88, 120, 120, 0x79, 0x77, 0x87, 
                0x95, 180, 150, 0xa5, 150, 0x97, 120, 0x79, 120, 0x69, 120, 0x87, 150, 180, 150, 0xa6, 
                0x97, 0x97, 0x79, 0x79, 0x79, 0x69, 120, 0x77, 150, 0xa4, 150, 150, 0x97, 0x87, 0x79, 0x79, 
                0x69, 0x69, 120, 120, 150, 0xa5, 150, 0xa5, 150, 0x97, 0x88, 120, 120, 0x79, 0x77, 0x87, 
                0x95, 180, 150, 0xa5, 150, 0x97, 120, 0x79, 120, 0x69, 120, 0x87, 150, 180, 150, 0xa6, 
                0x97, 0x97, 120, 0x79, 0x79, 0x69, 120, 0x77, 150, 0xa4, 150, 150, 0x97, 0x87, 0x79, 0x79, 
                0x79, 0x69, 120, 120, 150, 0xa5, 150, 0xa5, 150, 150, 0x88, 120, 120, 120, 0x87, 0x87, 
                0x95, 180, 150, 0xa5, 150, 0x97, 0x88, 120, 120, 0x79, 0x77, 0x87, 150, 180, 150, 0xa6, 
                0x97, 0x97, 120, 0x79, 0x79, 0x69, 120, 0x77, 150, 0xa4, 150, 150, 0x97, 0x87, 0x79, 0x79, 
                0x79, 0x69, 120, 120, 150, 0xa5, 150, 0xa5, 150, 150, 0x88, 120, 120, 120, 0x87, 0x87, 
                0x95, 180, 150, 0xa5, 150, 0x97, 0x88, 120, 120, 0x69, 120, 0x87, 150, 180, 150, 0xa6, 
                0x97, 0x97, 120, 0x79, 0x79, 0x69, 120, 0x77, 150, 0xa4, 150, 150, 0x97, 0x97, 0x79, 0x79, 
                0x79, 0x69, 120, 120, 150, 0xa5, 150, 0xa5, 150, 150, 0x88, 120, 120, 120, 0x87, 0x87, 
                0x95, 180, 150, 0xa5, 150, 0x97, 0x88, 120, 120, 0x69, 120, 0x87, 150, 180, 150, 0xa6, 
                0x97, 0x97, 120, 0x79, 0x79, 0x69, 120, 0x77, 150, 0xa4, 150, 150, 0x97, 0x97, 0x79, 0x79, 
                0x79, 0x69, 120, 120, 150, 0xa5, 150, 0xa5, 150, 150, 0x88, 120, 120, 120, 0x87, 0x87, 
                0x95, 180, 150, 0xa5, 150, 0x97, 0x88, 120, 120, 0x69, 120, 0x87, 150, 180, 150, 0xa6, 
                0x97, 0x97, 120, 0x79, 0x79, 0x69, 120, 0x77, 150, 0xa4, 150, 150, 0x97, 0x97, 0x79, 0x79, 
                0x79, 0x69, 120, 120, 150, 0xa5, 150, 0xa5, 0xa6, 150, 0x88, 120, 120, 120, 0x87, 0x87, 
                0x95, 180, 150, 0xa5, 150, 0x97, 0x88, 120, 120, 0x79, 0x77, 0x87, 0x95, 180, 150, 0xa6, 
                0x97, 0x97, 120, 0x79, 120, 0x69, 120, 0x77, 150, 180, 150, 0xa6, 0x97, 0x97, 0x79, 0x79, 
                0x79, 0x69, 120, 120, 150, 0xa5, 0xa6, 0xa5, 0xa6, 150, 0x88, 0x88, 120, 120, 0x87, 0x87, 
                0xa5, 180, 150, 0xa5, 150, 0x97, 0x88, 0x79, 120, 0x79, 0x77, 0x87, 0x95, 180, 150, 0xa5, 
                150, 0x97, 120, 0x79, 120, 0x69, 120, 0x77, 150, 180, 150, 0xa6, 0x97, 0x97, 0x79, 0x79, 
                0x79, 0x69, 120, 120, 150, 0xa5, 0xa6, 0xa5, 0xa6, 150, 0x88, 0x88, 120, 120, 0x87, 0x87, 
                0xa5, 180, 150, 0xa5, 150, 0x97, 0x88, 120, 120, 0x79, 0x77, 0x87, 0x95, 180, 150, 0xa5, 
                150, 0x97, 120, 0x79, 120, 0x68, 120, 0x87, 150, 180, 150, 0xa6, 0x97, 0x97, 120, 0x79, 
                0x79, 0x69, 120, 0x77, 150, 0xa5, 0xa5, 0xa5, 0xa6, 150, 0x88, 0x88, 120, 120, 0x87, 0x87, 
                0xa5, 180, 150, 0xa5, 150, 0x97, 0x88, 120, 120, 0x79, 0x77, 0x87, 0x95, 180, 150, 0xa5, 
                150, 0x97, 0x88, 120, 120, 0x69, 120, 0x87, 150, 180, 150, 0xa6, 0x97, 0x97, 120, 0x79, 
                0x79, 0x69, 120, 0x77, 150, 0xa4, 0xa5, 0xa5, 0xa6, 150, 0x88, 0x88, 0x88, 120, 0x87, 0x87, 
                0xa5, 180, 150, 0xa5, 150, 150, 0x88, 120, 120, 120, 0x87, 0x87, 150, 180, 150, 0xa5, 
                150, 0x97, 0x88, 120, 120, 0x69, 120, 0x87, 150, 180, 150, 0xa6, 0x97, 0x97, 120, 0x79, 
                0x79, 0x69, 120, 0x77, 150, 0xa4, 0xa5, 0xa5, 0xa6, 150, 0x88, 0x88, 0x88, 120, 0x87, 0x87, 
                0xa5, 180, 150, 0xa5, 150, 150, 0x88, 120, 120, 120, 0x87, 0x87, 0x95, 180, 150, 0xa5, 
                150, 0x97, 0x88, 120, 120, 0x69, 120, 0x87, 150, 180, 150, 0xa6, 0x97, 0x97, 120, 0x79, 
                0x79, 0x69, 120, 0x77, 150, 0xa4, 0xa5, 0xa5, 0xa6, 0xa6, 0x88, 0x88, 0x88, 120, 0x87, 0x87, 
                0xa5, 180, 150, 0xa5, 150, 150, 0x88, 120, 120, 120, 0x87, 0x87, 0x95, 180, 150, 0xa5, 
                150, 0x97, 0x88, 120, 120, 0x69, 120, 0x87, 150, 180, 150, 0xa6, 0x97, 0x97, 120, 0x79, 
                0x79, 0x69, 120, 0x77, 150, 0xa4, 0xa5, 0xa5, 0xa6, 0xa6, 0x88, 0x88, 0x88, 120, 0x87, 0x87, 
                0xa5, 0xb5, 150, 0xa5, 0xa6, 150, 0x88, 120, 120, 120, 0x87, 0x87, 0x95, 180, 150, 0xa5, 
                150, 0x97, 0x88, 120, 120, 0x69, 120, 0x87, 150, 180, 150, 0xa6, 0x97, 0x97, 120, 0x79, 
                120, 0x69, 120, 0x77, 150, 0xa4, 0xa5, 0xb5, 0xa6, 0xa6, 0x88, 0x89, 0x88, 120, 0x87, 0x87, 
                0xa5, 180, 150, 0xa5, 150, 150, 0x88, 0x88, 120, 120, 0x87, 0x87, 0x95, 180, 150, 0xa5, 
                150, 0x97, 0x88, 120, 120, 0x79, 120, 0x87, 150, 180, 150, 0xa6, 150, 0x97, 120, 0x79, 
                120, 0x69, 120, 0x77, 150, 0xa4, 0xa5, 0xb5, 0xa6, 0xa6, 0x88, 0x88, 0x88, 120, 0x87, 0x87, 
                0xa5, 180, 150, 0xa5, 0xa6, 150, 0x88, 0x88, 120, 120, 0x77, 0x87, 0x95, 180, 150, 0xa5, 
                150, 0x97, 0x88, 120, 120, 0x79, 0x77, 0x87, 0x95, 180, 150, 0xa5, 150, 0x97, 120, 0x79, 
                120, 0x69, 120, 0x77, 150, 180, 0xa5, 0xb5, 0xa6, 0xa6, 0x87, 0x88, 0x88, 120, 0x87, 0x87, 
                0xa5, 180, 0xa6, 0xa5, 0xa6, 150, 0x88, 0x88, 120, 120, 0x87, 0x87, 0xa5, 180, 150, 0xa5, 
                150, 0x97, 0x88, 120, 120, 0x79, 0x77, 0x87, 0x95, 180, 150, 0xa5, 150, 0x97, 0x88, 0x79, 
                120, 0x69, 120, 0x87, 150, 180, 0xa5, 0xb5, 0xa6, 0xa6, 0x87, 0x88, 0x88, 120, 0x87, 0x86, 
                0xa5, 180, 0xa5, 0xa5, 0xa6, 150, 0x88, 0x88, 0x88, 120, 0x87, 0x87, 0xa5, 180, 150, 0xa5, 
                150, 150, 0x88, 120, 120, 0x79, 0x77, 0x87, 0x95, 180, 150, 0xa5, 0x86, 0x97, 0x88, 120, 
                120, 0x69, 120, 0x87, 150, 180, 0xa5, 0xb5, 0xa6, 0xa6, 0x87, 0x88, 0x88, 120, 0x87, 0x86, 
                0xa5, 0xb3, 0xa5, 0xa5, 0xa6, 150, 0x88, 0x88, 0x88, 120, 0x87, 0x87, 0xa5, 180, 150, 0xa5, 
                150, 150, 0x88, 120, 120, 120, 0x87, 0x87, 0x95, 180, 150, 0xa5, 150, 0x97, 0x88, 0x76, 
                120, 0x69, 120, 0x87, 150, 180, 0xa5, 0xb5, 0xa6, 0xa6, 0x87, 0x88, 0x88, 120, 0x87, 0x86, 
                0xa5, 0xb3, 0xa5, 0xa5, 0xa6, 0xa6, 0x88, 0x88, 0x88, 120, 0x87, 0x87, 0xa5, 180, 150, 0xa5, 
                150, 150, 0x88, 120, 120, 120, 0x87, 0x87, 0x95, 180, 150, 0xa5, 150, 0x97, 0x88, 120, 
                120, 0x69, 120, 0x87, 150, 180, 0xa5, 0xb5, 0xa6, 0xa6, 0x87, 0x88, 0x88, 120, 0x87, 0x86, 
                0xa5, 0xb3, 0xa5, 0xa5, 0xa6, 0xa6, 0x88, 0x88, 0x88, 120, 0x87, 0x87, 0xa5, 180, 150, 0xa5, 
                150, 150, 0x88, 120, 120, 120, 0x87, 0x87, 0x95, 180, 150, 0xa5, 150, 0x97, 0x88, 120, 
                120, 0x69, 120, 0x87, 150, 180, 0xa5, 0xb5, 0xa6, 0xa6, 0x87, 0x88, 0x88, 120, 0x87, 0x86, 
                0xa5, 0xb3, 0xa5, 0xa5, 0xa6, 0xa6, 0x88, 0x88, 0x88, 120, 0x87, 0x87, 0xa5, 180, 150, 0xa5, 
                0xa6, 150, 0x88, 0x88, 120, 120, 0x87, 0x87, 0x95, 180, 150, 0xa5, 150, 0x97, 0x88, 120, 
                120, 0x69, 120, 0x87, 150, 180, 0xa5, 0xb5, 0xa6, 0xa6, 0x87, 0x88, 0x87, 120, 0x87, 0x86, 
                0xa5, 0xb3, 0xa5, 0xb5, 0xa6, 0xa6, 0x88, 0x88, 0x88, 120, 0x87, 0x87, 0xa5, 180, 150, 0xa5, 
                0xa6, 150, 0x88, 0x88, 120, 120, 0x87, 0x87, 0x95, 180, 150, 0xa5, 150, 0x97, 0x88, 120, 
                120, 0x79, 120, 0x87, 150, 180, 0xa5, 0xb5, 0xa5, 0xa6, 0x87, 0x88, 0x87, 120, 0x87, 0x86, 
                0xa5, 0xb3, 0xa5, 0xb5, 0xa6, 0xa6, 0x87, 0x88, 0x88, 120, 0x87, 0x87, 0xa5, 180, 150, 0xa5, 
                0xa6, 150, 0x88, 0x88, 120, 120, 0x87, 0x87, 0x95, 180, 150, 0xa5, 150, 0x97, 0x88, 120, 
                120, 0x79, 0x77, 0x87, 0x95, 180, 0xa5, 180, 0xa5, 0xa6, 0x87, 0x88, 0x87, 120, 0x87, 0x86, 
                0xa5, 0xc3, 0xa5, 0xb5, 0xa6, 0xa6, 0x87, 0x88, 0x88, 120, 0x87, 0x87, 0xa5, 180, 0xa6, 0xa5, 
                0xa6, 150, 0x88, 0x88, 120, 120, 0x87, 0x87, 0xa5, 180, 150, 0xa5, 150, 150, 0x88, 120, 
                120, 0x79, 0x77, 0x87, 0x95, 180, 0xa5, 180, 0xa5, 0xa6, 0x97, 0x87, 0x87, 120, 0x87, 0x86, 
                0xa5, 0xc3, 0xa5, 0xb5, 0xa6, 0xa6, 0x87, 0x88, 0x88, 120, 0x87, 0x86, 0xa5, 180, 0xa5, 0xa5, 
                0xa6, 150, 0x88, 0x88, 0x88, 120, 0x87, 0x87, 0xa5, 180, 150, 0xa5, 150, 150, 0x88, 120, 
                120, 0x79, 0x77, 0x87, 0x95, 180, 0xa5, 180, 0xa5, 0xa6, 0x97, 0x87, 0x87, 120, 0x87, 150, 
                0xa5, 0xc3, 0xa5, 0xb5, 0xa6, 0xa6, 0x87, 0x88, 0x88, 120, 0x87, 0x86, 0xa5, 0xb3, 0xa5, 0xa5, 
                0xa6, 0xa6, 0x88, 0x88, 0x88, 120, 0x87, 0x87, 0xa5, 180, 150, 0xa5, 150, 150, 0x88, 120, 
                120, 120, 0x87, 0x87, 0x95, 180, 0xa5, 180, 0xa5, 0xa6, 0x97, 0x87, 0x87, 120, 0x87, 150, 
                0xa5, 0xc3, 0xa5, 0xb5, 0xa6, 0xa6, 0x87, 0x88, 0x88, 120, 0x87, 0x86, 0xa5, 0xb3, 0xa5, 0xa5, 
                0xa6, 0xa6, 0x88, 0x88, 0x88, 120, 0x87, 0x87, 0xa5, 180, 150, 0xa5, 150, 150, 0x88, 120, 
                120, 120, 0x87, 0x87, 0x95, 180, 0xa5, 180, 0xa5, 0xa6, 0x97, 0x87, 0x87, 120, 0x87, 150, 
                0xa5, 0xc3, 0xa5, 0xb5, 0xa6, 0xa6, 0x88, 0x88, 0x88, 120, 0x87, 0x86, 0xa5, 0xb3, 0xa5, 0xa5, 
                0xa6, 0xa6, 0x88, 120, 0x88, 120, 0x87, 0x87, 0xa5, 180, 150, 0xa5, 0xa6, 150, 0x88, 0x88, 
                120, 120, 0x87, 0x87, 0x95, 180, 0xa5, 180, 0xa5, 0xa6, 0x97, 0x87, 0x87, 120, 0x87, 150, 
                0xa5, 0xc3, 0xa5, 0xb5, 0xa6, 0xa6, 0x87, 0x88, 0x88, 120, 0x87, 0x86, 0xa5, 0xb3, 0xa5, 0xa5, 
                0xa6, 0xa6, 0x88, 0x88, 0x88, 120, 0x87, 0x87, 0xa5, 180, 150, 0xa5, 0xa6, 150, 0x88, 0x88, 
                120, 120, 0x87, 0x87, 0x95, 180, 0xa5, 180, 0xa5, 0xa6, 0x97, 0x87, 0x87, 120, 0x87, 150, 
                0xa5, 0xc3, 0xa5, 0xb5, 0xa5, 0xa6, 0x87, 0x88, 0x87, 120, 0x87, 0x86, 0xa5, 0xb3, 0xa5, 0xb5, 
                0xa6, 0xa6, 0x88, 0x88, 0x88, 120, 0x87, 0x87, 0xa5, 180, 150, 0xa5, 0xa6, 150, 0x88, 0x88, 
                120, 120, 0x87, 0x87, 0x95, 180, 0xa5, 180, 0xa5, 0xa6, 0x97, 0x87, 0x87, 0x88, 0x87, 150, 
                0xa5, 0xc3, 0xa5, 180, 0xa5, 0xa6, 0x87, 0x88, 0x87, 120, 0x87, 0x86, 0xa5, 0xb3, 0xa5, 0xb5, 
                0xa6, 0xa6, 0x87, 0x88, 0x88, 120, 0x87, 0x87, 0xa5, 180, 150, 0xa5, 0xa6, 150, 0x88, 0x88, 
                120, 120, 0x87, 0x87, 0x95, 180, 0xa5, 180, 0xa5, 0xa5, 0x97, 0x87, 0x87, 0x88, 0x86, 150, 
                0xa4, 0xc3, 0xa5, 0xa5, 0xa5, 0xa6, 0x97, 0x87, 0x87, 120, 0x87, 0x86, 0xa5, 0xc3, 0xa5, 0xb5, 
                0xa6, 0xa6, 0x87, 0x88, 120, 120, 0x87, 0x87
             };
            this.Date = DateTime.Today;
        }

        public CNDate(DateTime dt)
        {
            this.ConstellationName = new string[] { "白羊座", "金牛座", "双子座", "巨蟹座", "狮子座", "处女座", "天秤座", "天蝎座", "射手座", "摩羯座", "水瓶座", "双鱼座" };
            this.LunarHolDayName = new string[] { 
                "小寒", "大寒", "立春", "雨水", "惊蛰", "春分", "清明", "谷雨", "立夏", "小满", "芒种", "夏至", "小暑", "大暑", "立秋", "处暑", 
                "白露", "秋分", "寒露", "霜降", "立冬", "小雪", "大雪", "冬至"
             };
            this.gLunarMonthDay = new int[] { 
                0x4ae0, 0xa570, 0x5268, 0xd260, 0xd950, 0x6aa8, 0x56a0, 0x9ad0, 0x4ae8, 0x4ae0, 0xa4d8, 0xa4d0, 0xd250, 0xd548, 0xb550, 0x56a0, 
                0x96d0, 0x95b0, 0x49b8, 0x49b0, 0xa4b0, 0xb258, 0x6a50, 0x6d40, 0xada8, 0x2b60, 0x9570, 0x4978, 0x4970, 0x64b0, 0xd4a0, 0xea50, 
                0x6d48, 0x5ad0, 0x2b60, 0x9370, 0x92e0, 0xc968, 0xc950, 0xd4a0, 0xda50, 0xb550, 0x56a0, 0xaad8, 0x25d0, 0x92d0, 0xc958, 0xa950, 
                0xb4a8, 0x6ca0, 0xb550, 0x55a8, 0x4da0, 0xa5b0, 0x52b8, 0x52b0, 0xa950, 0xe950, 0x6aa0, 0xad50, 0xab50, 0x4b60, 0xa570, 0xa570, 
                0x5260, 0xe930, 0xd950, 0x5aa8, 0x56a0, 0x96d0, 0x4ae8, 0x4ad0, 0xa4d0, 0xd268, 0xd250, 0xd528, 0xb540, 0xb6a0, 0x96d0, 0x95b0, 
                0x49b0, 0xa4b8, 0xa4b0, 0xb258, 0x6a50, 0x6d40, 0xada0, 0xab60, 0x9370, 0x4978, 0x4970, 0x64b0, 0x6a50, 0xea50, 0x6b28, 0x5ac0, 
                0xab60, 0x9368, 0x92e0, 0xc960, 0xd4a8, 0xd4a0, 0xda50, 0x5aa8, 0x56a0, 0xaad8, 0x25d0, 0x92d0, 0xc958, 0xa950, 0xb4a0, 0xb550, 
                0xb550, 0x55a8, 0x4ba0, 0xa5b0, 0x52b8, 0x52b0, 0xa930, 0x74a8, 0x6aa0, 0xad50, 0x4da8, 0x4b60, 0x9570, 0xa4e0, 0xd260, 0xe930, 
                0xd530, 0x5aa0, 0x6b50, 0x96d0, 0x4ae8, 0x4ad0, 0xa4d0, 0xd258, 0xd250, 0xd520, 0xdaa0, 0xb5a0, 0x56d0, 0x4ad8, 0x49b0, 0xa4b8, 
                0xa4b0, 0xaa50, 0xb528, 0x6d20, 0xada0, 0x55b0
             };
            this.gLunarMonth = new byte[] { 
                0, 80, 4, 0, 0x20, 0x60, 5, 0, 0x20, 0x70, 5, 0, 0x40, 2, 6, 0, 
                80, 3, 7, 0, 0x60, 4, 0, 0x20, 0x70, 5, 0, 0x30, 0x80, 6, 0, 0x40, 
                3, 7, 0, 80, 4, 8, 0, 0x60, 4, 10, 0, 0x60, 5, 0, 0x30, 0x80, 
                5, 0, 0x40, 2, 7, 0, 80, 4, 9, 0, 0x60, 4, 0, 0x20, 0x60, 5, 
                0, 0x30, 0xb0, 6, 0, 80, 2, 7, 0, 80, 3
             };
            this.gLunarHolDay = new byte[] { 
                150, 180, 150, 0xa6, 0x97, 0x97, 120, 0x79, 0x79, 0x69, 120, 0x77, 150, 0xa4, 150, 150, 
                0x97, 0x87, 0x79, 0x79, 0x79, 0x69, 120, 120, 150, 0xa5, 0x87, 150, 0x87, 0x87, 0x79, 0x69, 
                0x69, 0x69, 120, 120, 0x86, 0xa5, 150, 0xa5, 150, 0x97, 0x88, 120, 120, 0x79, 120, 0x87, 
                150, 180, 150, 0xa6, 0x97, 0x97, 120, 0x79, 0x79, 0x69, 120, 0x77, 150, 0xa4, 150, 150, 
                0x97, 0x97, 0x79, 0x79, 0x79, 0x69, 120, 120, 150, 0xa5, 0x87, 150, 0x87, 0x87, 0x79, 0x69, 
                0x69, 0x69, 120, 120, 0x86, 0xa5, 150, 0xa5, 150, 0x97, 0x88, 120, 120, 0x69, 120, 0x87, 
                150, 180, 150, 0xa6, 0x97, 0x97, 120, 0x79, 0x79, 0x69, 120, 0x77, 150, 0xa4, 150, 150, 
                0x97, 0x97, 0x79, 0x79, 0x79, 0x69, 120, 120, 150, 0xa5, 0x87, 150, 0x87, 0x87, 0x79, 0x69, 
                0x69, 0x69, 120, 120, 0x86, 0xa5, 150, 0xa5, 150, 0x97, 0x88, 120, 120, 0x69, 120, 0x87, 
                0x95, 180, 150, 0xa6, 0x97, 0x97, 120, 0x79, 0x79, 0x69, 120, 0x77, 150, 180, 150, 0xa6, 
                0x97, 0x97, 0x79, 0x79, 0x79, 0x69, 120, 120, 150, 0xa5, 0x97, 150, 0x97, 0x87, 0x79, 0x79, 
                0x69, 0x69, 120, 120, 150, 0xa5, 150, 0xa5, 150, 0x97, 0x88, 120, 120, 0x79, 0x77, 0x87, 
                0x95, 180, 150, 0xa6, 150, 0x97, 120, 0x79, 120, 0x69, 120, 0x87, 150, 180, 150, 0xa6, 
                0x97, 0x97, 0x79, 0x79, 0x79, 0x69, 120, 0x77, 150, 0xa5, 0x97, 150, 0x97, 0x87, 0x79, 0x79, 
                0x69, 0x69, 120, 120, 150, 0xa5, 150, 0xa5, 150, 0x97, 0x88, 120, 120, 0x79, 0x77, 0x87, 
                0x95, 180, 150, 0xa5, 150, 0x97, 120, 0x79, 120, 0x69, 120, 0x87, 150, 180, 150, 0xa6, 
                0x97, 0x97, 0x79, 0x79, 0x79, 0x69, 120, 0x77, 150, 0xa4, 150, 150, 0x97, 0x87, 0x79, 0x79, 
                0x69, 0x69, 120, 120, 150, 0xa5, 150, 0xa5, 150, 0x97, 0x88, 120, 120, 0x79, 0x77, 0x87, 
                0x95, 180, 150, 0xa5, 150, 0x97, 120, 0x79, 120, 0x69, 120, 0x87, 150, 180, 150, 0xa6, 
                0x97, 0x97, 120, 0x79, 0x79, 0x69, 120, 0x77, 150, 0xa4, 150, 150, 0x97, 0x87, 0x79, 0x79, 
                0x79, 0x69, 120, 120, 150, 0xa5, 150, 0xa5, 150, 150, 0x88, 120, 120, 120, 0x87, 0x87, 
                0x95, 180, 150, 0xa5, 150, 0x97, 0x88, 120, 120, 0x79, 0x77, 0x87, 150, 180, 150, 0xa6, 
                0x97, 0x97, 120, 0x79, 0x79, 0x69, 120, 0x77, 150, 0xa4, 150, 150, 0x97, 0x87, 0x79, 0x79, 
                0x79, 0x69, 120, 120, 150, 0xa5, 150, 0xa5, 150, 150, 0x88, 120, 120, 120, 0x87, 0x87, 
                0x95, 180, 150, 0xa5, 150, 0x97, 0x88, 120, 120, 0x69, 120, 0x87, 150, 180, 150, 0xa6, 
                0x97, 0x97, 120, 0x79, 0x79, 0x69, 120, 0x77, 150, 0xa4, 150, 150, 0x97, 0x97, 0x79, 0x79, 
                0x79, 0x69, 120, 120, 150, 0xa5, 150, 0xa5, 150, 150, 0x88, 120, 120, 120, 0x87, 0x87, 
                0x95, 180, 150, 0xa5, 150, 0x97, 0x88, 120, 120, 0x69, 120, 0x87, 150, 180, 150, 0xa6, 
                0x97, 0x97, 120, 0x79, 0x79, 0x69, 120, 0x77, 150, 0xa4, 150, 150, 0x97, 0x97, 0x79, 0x79, 
                0x79, 0x69, 120, 120, 150, 0xa5, 150, 0xa5, 150, 150, 0x88, 120, 120, 120, 0x87, 0x87, 
                0x95, 180, 150, 0xa5, 150, 0x97, 0x88, 120, 120, 0x69, 120, 0x87, 150, 180, 150, 0xa6, 
                0x97, 0x97, 120, 0x79, 0x79, 0x69, 120, 0x77, 150, 0xa4, 150, 150, 0x97, 0x97, 0x79, 0x79, 
                0x79, 0x69, 120, 120, 150, 0xa5, 150, 0xa5, 0xa6, 150, 0x88, 120, 120, 120, 0x87, 0x87, 
                0x95, 180, 150, 0xa5, 150, 0x97, 0x88, 120, 120, 0x79, 0x77, 0x87, 0x95, 180, 150, 0xa6, 
                0x97, 0x97, 120, 0x79, 120, 0x69, 120, 0x77, 150, 180, 150, 0xa6, 0x97, 0x97, 0x79, 0x79, 
                0x79, 0x69, 120, 120, 150, 0xa5, 0xa6, 0xa5, 0xa6, 150, 0x88, 0x88, 120, 120, 0x87, 0x87, 
                0xa5, 180, 150, 0xa5, 150, 0x97, 0x88, 0x79, 120, 0x79, 0x77, 0x87, 0x95, 180, 150, 0xa5, 
                150, 0x97, 120, 0x79, 120, 0x69, 120, 0x77, 150, 180, 150, 0xa6, 0x97, 0x97, 0x79, 0x79, 
                0x79, 0x69, 120, 120, 150, 0xa5, 0xa6, 0xa5, 0xa6, 150, 0x88, 0x88, 120, 120, 0x87, 0x87, 
                0xa5, 180, 150, 0xa5, 150, 0x97, 0x88, 120, 120, 0x79, 0x77, 0x87, 0x95, 180, 150, 0xa5, 
                150, 0x97, 120, 0x79, 120, 0x68, 120, 0x87, 150, 180, 150, 0xa6, 0x97, 0x97, 120, 0x79, 
                0x79, 0x69, 120, 0x77, 150, 0xa5, 0xa5, 0xa5, 0xa6, 150, 0x88, 0x88, 120, 120, 0x87, 0x87, 
                0xa5, 180, 150, 0xa5, 150, 0x97, 0x88, 120, 120, 0x79, 0x77, 0x87, 0x95, 180, 150, 0xa5, 
                150, 0x97, 0x88, 120, 120, 0x69, 120, 0x87, 150, 180, 150, 0xa6, 0x97, 0x97, 120, 0x79, 
                0x79, 0x69, 120, 0x77, 150, 0xa4, 0xa5, 0xa5, 0xa6, 150, 0x88, 0x88, 0x88, 120, 0x87, 0x87, 
                0xa5, 180, 150, 0xa5, 150, 150, 0x88, 120, 120, 120, 0x87, 0x87, 150, 180, 150, 0xa5, 
                150, 0x97, 0x88, 120, 120, 0x69, 120, 0x87, 150, 180, 150, 0xa6, 0x97, 0x97, 120, 0x79, 
                0x79, 0x69, 120, 0x77, 150, 0xa4, 0xa5, 0xa5, 0xa6, 150, 0x88, 0x88, 0x88, 120, 0x87, 0x87, 
                0xa5, 180, 150, 0xa5, 150, 150, 0x88, 120, 120, 120, 0x87, 0x87, 0x95, 180, 150, 0xa5, 
                150, 0x97, 0x88, 120, 120, 0x69, 120, 0x87, 150, 180, 150, 0xa6, 0x97, 0x97, 120, 0x79, 
                0x79, 0x69, 120, 0x77, 150, 0xa4, 0xa5, 0xa5, 0xa6, 0xa6, 0x88, 0x88, 0x88, 120, 0x87, 0x87, 
                0xa5, 180, 150, 0xa5, 150, 150, 0x88, 120, 120, 120, 0x87, 0x87, 0x95, 180, 150, 0xa5, 
                150, 0x97, 0x88, 120, 120, 0x69, 120, 0x87, 150, 180, 150, 0xa6, 0x97, 0x97, 120, 0x79, 
                0x79, 0x69, 120, 0x77, 150, 0xa4, 0xa5, 0xa5, 0xa6, 0xa6, 0x88, 0x88, 0x88, 120, 0x87, 0x87, 
                0xa5, 0xb5, 150, 0xa5, 0xa6, 150, 0x88, 120, 120, 120, 0x87, 0x87, 0x95, 180, 150, 0xa5, 
                150, 0x97, 0x88, 120, 120, 0x69, 120, 0x87, 150, 180, 150, 0xa6, 0x97, 0x97, 120, 0x79, 
                120, 0x69, 120, 0x77, 150, 0xa4, 0xa5, 0xb5, 0xa6, 0xa6, 0x88, 0x89, 0x88, 120, 0x87, 0x87, 
                0xa5, 180, 150, 0xa5, 150, 150, 0x88, 0x88, 120, 120, 0x87, 0x87, 0x95, 180, 150, 0xa5, 
                150, 0x97, 0x88, 120, 120, 0x79, 120, 0x87, 150, 180, 150, 0xa6, 150, 0x97, 120, 0x79, 
                120, 0x69, 120, 0x77, 150, 0xa4, 0xa5, 0xb5, 0xa6, 0xa6, 0x88, 0x88, 0x88, 120, 0x87, 0x87, 
                0xa5, 180, 150, 0xa5, 0xa6, 150, 0x88, 0x88, 120, 120, 0x77, 0x87, 0x95, 180, 150, 0xa5, 
                150, 0x97, 0x88, 120, 120, 0x79, 0x77, 0x87, 0x95, 180, 150, 0xa5, 150, 0x97, 120, 0x79, 
                120, 0x69, 120, 0x77, 150, 180, 0xa5, 0xb5, 0xa6, 0xa6, 0x87, 0x88, 0x88, 120, 0x87, 0x87, 
                0xa5, 180, 0xa6, 0xa5, 0xa6, 150, 0x88, 0x88, 120, 120, 0x87, 0x87, 0xa5, 180, 150, 0xa5, 
                150, 0x97, 0x88, 120, 120, 0x79, 0x77, 0x87, 0x95, 180, 150, 0xa5, 150, 0x97, 0x88, 0x79, 
                120, 0x69, 120, 0x87, 150, 180, 0xa5, 0xb5, 0xa6, 0xa6, 0x87, 0x88, 0x88, 120, 0x87, 0x86, 
                0xa5, 180, 0xa5, 0xa5, 0xa6, 150, 0x88, 0x88, 0x88, 120, 0x87, 0x87, 0xa5, 180, 150, 0xa5, 
                150, 150, 0x88, 120, 120, 0x79, 0x77, 0x87, 0x95, 180, 150, 0xa5, 0x86, 0x97, 0x88, 120, 
                120, 0x69, 120, 0x87, 150, 180, 0xa5, 0xb5, 0xa6, 0xa6, 0x87, 0x88, 0x88, 120, 0x87, 0x86, 
                0xa5, 0xb3, 0xa5, 0xa5, 0xa6, 150, 0x88, 0x88, 0x88, 120, 0x87, 0x87, 0xa5, 180, 150, 0xa5, 
                150, 150, 0x88, 120, 120, 120, 0x87, 0x87, 0x95, 180, 150, 0xa5, 150, 0x97, 0x88, 0x76, 
                120, 0x69, 120, 0x87, 150, 180, 0xa5, 0xb5, 0xa6, 0xa6, 0x87, 0x88, 0x88, 120, 0x87, 0x86, 
                0xa5, 0xb3, 0xa5, 0xa5, 0xa6, 0xa6, 0x88, 0x88, 0x88, 120, 0x87, 0x87, 0xa5, 180, 150, 0xa5, 
                150, 150, 0x88, 120, 120, 120, 0x87, 0x87, 0x95, 180, 150, 0xa5, 150, 0x97, 0x88, 120, 
                120, 0x69, 120, 0x87, 150, 180, 0xa5, 0xb5, 0xa6, 0xa6, 0x87, 0x88, 0x88, 120, 0x87, 0x86, 
                0xa5, 0xb3, 0xa5, 0xa5, 0xa6, 0xa6, 0x88, 0x88, 0x88, 120, 0x87, 0x87, 0xa5, 180, 150, 0xa5, 
                150, 150, 0x88, 120, 120, 120, 0x87, 0x87, 0x95, 180, 150, 0xa5, 150, 0x97, 0x88, 120, 
                120, 0x69, 120, 0x87, 150, 180, 0xa5, 0xb5, 0xa6, 0xa6, 0x87, 0x88, 0x88, 120, 0x87, 0x86, 
                0xa5, 0xb3, 0xa5, 0xa5, 0xa6, 0xa6, 0x88, 0x88, 0x88, 120, 0x87, 0x87, 0xa5, 180, 150, 0xa5, 
                0xa6, 150, 0x88, 0x88, 120, 120, 0x87, 0x87, 0x95, 180, 150, 0xa5, 150, 0x97, 0x88, 120, 
                120, 0x69, 120, 0x87, 150, 180, 0xa5, 0xb5, 0xa6, 0xa6, 0x87, 0x88, 0x87, 120, 0x87, 0x86, 
                0xa5, 0xb3, 0xa5, 0xb5, 0xa6, 0xa6, 0x88, 0x88, 0x88, 120, 0x87, 0x87, 0xa5, 180, 150, 0xa5, 
                0xa6, 150, 0x88, 0x88, 120, 120, 0x87, 0x87, 0x95, 180, 150, 0xa5, 150, 0x97, 0x88, 120, 
                120, 0x79, 120, 0x87, 150, 180, 0xa5, 0xb5, 0xa5, 0xa6, 0x87, 0x88, 0x87, 120, 0x87, 0x86, 
                0xa5, 0xb3, 0xa5, 0xb5, 0xa6, 0xa6, 0x87, 0x88, 0x88, 120, 0x87, 0x87, 0xa5, 180, 150, 0xa5, 
                0xa6, 150, 0x88, 0x88, 120, 120, 0x87, 0x87, 0x95, 180, 150, 0xa5, 150, 0x97, 0x88, 120, 
                120, 0x79, 0x77, 0x87, 0x95, 180, 0xa5, 180, 0xa5, 0xa6, 0x87, 0x88, 0x87, 120, 0x87, 0x86, 
                0xa5, 0xc3, 0xa5, 0xb5, 0xa6, 0xa6, 0x87, 0x88, 0x88, 120, 0x87, 0x87, 0xa5, 180, 0xa6, 0xa5, 
                0xa6, 150, 0x88, 0x88, 120, 120, 0x87, 0x87, 0xa5, 180, 150, 0xa5, 150, 150, 0x88, 120, 
                120, 0x79, 0x77, 0x87, 0x95, 180, 0xa5, 180, 0xa5, 0xa6, 0x97, 0x87, 0x87, 120, 0x87, 0x86, 
                0xa5, 0xc3, 0xa5, 0xb5, 0xa6, 0xa6, 0x87, 0x88, 0x88, 120, 0x87, 0x86, 0xa5, 180, 0xa5, 0xa5, 
                0xa6, 150, 0x88, 0x88, 0x88, 120, 0x87, 0x87, 0xa5, 180, 150, 0xa5, 150, 150, 0x88, 120, 
                120, 0x79, 0x77, 0x87, 0x95, 180, 0xa5, 180, 0xa5, 0xa6, 0x97, 0x87, 0x87, 120, 0x87, 150, 
                0xa5, 0xc3, 0xa5, 0xb5, 0xa6, 0xa6, 0x87, 0x88, 0x88, 120, 0x87, 0x86, 0xa5, 0xb3, 0xa5, 0xa5, 
                0xa6, 0xa6, 0x88, 0x88, 0x88, 120, 0x87, 0x87, 0xa5, 180, 150, 0xa5, 150, 150, 0x88, 120, 
                120, 120, 0x87, 0x87, 0x95, 180, 0xa5, 180, 0xa5, 0xa6, 0x97, 0x87, 0x87, 120, 0x87, 150, 
                0xa5, 0xc3, 0xa5, 0xb5, 0xa6, 0xa6, 0x87, 0x88, 0x88, 120, 0x87, 0x86, 0xa5, 0xb3, 0xa5, 0xa5, 
                0xa6, 0xa6, 0x88, 0x88, 0x88, 120, 0x87, 0x87, 0xa5, 180, 150, 0xa5, 150, 150, 0x88, 120, 
                120, 120, 0x87, 0x87, 0x95, 180, 0xa5, 180, 0xa5, 0xa6, 0x97, 0x87, 0x87, 120, 0x87, 150, 
                0xa5, 0xc3, 0xa5, 0xb5, 0xa6, 0xa6, 0x88, 0x88, 0x88, 120, 0x87, 0x86, 0xa5, 0xb3, 0xa5, 0xa5, 
                0xa6, 0xa6, 0x88, 120, 0x88, 120, 0x87, 0x87, 0xa5, 180, 150, 0xa5, 0xa6, 150, 0x88, 0x88, 
                120, 120, 0x87, 0x87, 0x95, 180, 0xa5, 180, 0xa5, 0xa6, 0x97, 0x87, 0x87, 120, 0x87, 150, 
                0xa5, 0xc3, 0xa5, 0xb5, 0xa6, 0xa6, 0x87, 0x88, 0x88, 120, 0x87, 0x86, 0xa5, 0xb3, 0xa5, 0xa5, 
                0xa6, 0xa6, 0x88, 0x88, 0x88, 120, 0x87, 0x87, 0xa5, 180, 150, 0xa5, 0xa6, 150, 0x88, 0x88, 
                120, 120, 0x87, 0x87, 0x95, 180, 0xa5, 180, 0xa5, 0xa6, 0x97, 0x87, 0x87, 120, 0x87, 150, 
                0xa5, 0xc3, 0xa5, 0xb5, 0xa5, 0xa6, 0x87, 0x88, 0x87, 120, 0x87, 0x86, 0xa5, 0xb3, 0xa5, 0xb5, 
                0xa6, 0xa6, 0x88, 0x88, 0x88, 120, 0x87, 0x87, 0xa5, 180, 150, 0xa5, 0xa6, 150, 0x88, 0x88, 
                120, 120, 0x87, 0x87, 0x95, 180, 0xa5, 180, 0xa5, 0xa6, 0x97, 0x87, 0x87, 0x88, 0x87, 150, 
                0xa5, 0xc3, 0xa5, 180, 0xa5, 0xa6, 0x87, 0x88, 0x87, 120, 0x87, 0x86, 0xa5, 0xb3, 0xa5, 0xb5, 
                0xa6, 0xa6, 0x87, 0x88, 0x88, 120, 0x87, 0x87, 0xa5, 180, 150, 0xa5, 0xa6, 150, 0x88, 0x88, 
                120, 120, 0x87, 0x87, 0x95, 180, 0xa5, 180, 0xa5, 0xa5, 0x97, 0x87, 0x87, 0x88, 0x86, 150, 
                0xa4, 0xc3, 0xa5, 0xa5, 0xa5, 0xa6, 0x97, 0x87, 0x87, 120, 0x87, 0x86, 0xa5, 0xc3, 0xa5, 0xb5, 
                0xa6, 0xa6, 0x87, 0x88, 120, 120, 0x87, 0x87
             };
            this.Date = dt.Date;
        }

        public string FormatLunarDay(ushort iDay)
        {
            string str = "初十廿三";
            string str2 = "一二三四五六七八九十";
            if ((iDay != 20) && (iDay != 30))
            {
                return (str.Substring((iDay - 1) / 10, 1) + str2.Substring((iDay - 1) % 10, 1));
            }
            return (str.Substring(((iDay / 10) * 2) + 1, 2) + "十");
        }

        public string FormatLunarYear()
        {
            string str2 = "甲乙丙丁戊己庚辛壬癸";
            string str3 = "子丑寅卯辰巳午未申酉戌亥";
            string str4 = "鼠牛虎免龙蛇马羊猴鸡狗猪";
            ushort year = (ushort) this.m_Date.Year;
            return ((str2.Substring((year - 4) % 10, 1) + str3.Substring((year - 4) % 12, 1) + " ") + str4.Substring((year - 4) % 12, 1) + "年");
        }

        public string FormatLunarYear1()
        {
            string str2 = "甲乙丙丁戊己庚辛壬癸";
            string str3 = "子丑寅卯辰巳午未申酉戌亥";
            ushort year = (ushort) this.m_Date.Year;
            return (str2.Substring((year - 4) % 10, 1) + str3.Substring((year - 4) % 12, 1));
        }

        public string FormatLunarYear2()
        {
            string str2 = "鼠牛虎免龙蛇马羊猴鸡狗猪";
            ushort year = (ushort) this.m_Date.Year;
            return str2.Substring((year - 4) % 12, 1);
        }

        public string FormatMonth(ushort iMonth, bool bLunar)
        {
            string str2;
            string str = "正二三四五六七八九十";
            if (!(bLunar || (iMonth != 1)))
            {
                return "一月";
            }
            if (iMonth <= 10)
            {
                str2 = "";
                return (str2 + str.Substring(iMonth - 1, 1) + "月");
            }
            if (iMonth == 11)
            {
                str2 = "十一";
            }
            else
            {
                str2 = "十二";
            }
            return (str2 + "月");
        }

        public int GetConstellation()
        {
            int year = this.m_Date.Year;
            int month = this.m_Date.Month;
            int day = this.m_Date.Day;
            year = (month * 100) + day;
            if ((year >= 0x141) && (year <= 0x1a3))
            {
                return 0;
            }
            if ((year >= 420) && (year <= 520))
            {
                return 1;
            }
            if ((year >= 0x209) && (year <= 620))
            {
                return 2;
            }
            if ((year >= 0x26d) && (year <= 0x2d2))
            {
                return 3;
            }
            if ((year >= 0x2d3) && (year <= 0x336))
            {
                return 4;
            }
            if ((year >= 0x337) && (year <= 0x39a))
            {
                return 5;
            }
            if ((year >= 0x39b) && (year <= 0x3fe))
            {
                return 6;
            }
            if ((year >= 0x3ff) && (year <= 0x461))
            {
                return 7;
            }
            if ((year >= 0x462) && (year <= 0x4c5))
            {
                return 8;
            }
            if ((year >= 0x4c6) || (year <= 0x77))
            {
                return 9;
            }
            if ((year >= 120) && (year <= 0xda))
            {
                return 10;
            }
            if ((year >= 0xdb) && (year <= 320))
            {
                return 11;
            }
            return -1;
        }

        public string GetConstellationName()
        {
            int constellation = this.GetConstellation();
            if ((constellation >= 0) && (constellation <= 11))
            {
                return this.ConstellationName[constellation];
            }
            return "";
        }

        public int GetLeapMonth(ushort iLunarYear)
        {
            if ((iLunarYear < 0x76d) || (iLunarYear > 0x802))
            {
                return 0;
            }
            byte num = this.gLunarMonth[(iLunarYear - 0x76d) / 2];
            if (((iLunarYear - 0x76d) % 2) == 0)
            {
                return (num >> 4);
            }
            return (num & 15);
        }

        public string GetLunarHolDay()
        {
            ushort num2;
            ushort num3;
            ushort year = (ushort) this.m_Date.Year;
            if ((year < 0x76d) || (year > 0x802))
            {
                return "";
            }
            int index = this.l_GetLunarHolDay();
            if ((index >= 0) && (index <= 0x17))
            {
                return this.LunarHolDayName[index];
            }
            TimeSpan span = (TimeSpan) (this.m_Date - new DateTime(0x76d, 1, 1));
            this.l_CalcLunarDate(out year, out num2, out num3, (uint) span.Days);
            return (this.FormatMonth(num2, true) + this.FormatLunarDay(num3));
        }

        public void l_CalcLunarDate(out ushort iYear, out ushort iMonth, out ushort iDay, uint iSpanDays)
        {
            if (iSpanDays < 0x31)
            {
                iYear = 0x76c;
                if (iSpanDays < 0x13)
                {
                    iMonth = 11;
                    iDay = (ushort) (11 + iSpanDays);
                }
                else
                {
                    iMonth = 12;
                    iDay = (ushort) (iSpanDays - 0x12);
                }
            }
            else
            {
                uint num;
                iSpanDays -= 0x31;
                iYear = 0x76d;
                iMonth = 1;
                iDay = 1;
                for (num = (uint) this.LunarYearDays(iYear); iSpanDays >= num; num = (uint) this.LunarYearDays(iYear))
                {
                    iSpanDays -= num;
                    iYear = (ushort) (iYear + 1);
                }
                for (num = this.LunarMonthDays(iYear, iMonth); iSpanDays >= num; num = this.LunarMonthDays(iYear, iMonth))
                {
                    iSpanDays -= num;
                    if (iMonth == this.GetLeapMonth(iYear))
                    {
                        num = (this.LunarMonthDays(iYear, iMonth) >> 0x10) & 0xffff;
                        if (iSpanDays < num)
                        {
                            break;
                        }
                        iSpanDays -= num;
                    }
                    iMonth = (ushort) (iMonth + 1);
                }
                iDay = (ushort) (iDay + iSpanDays);
            }
        }

        public int l_GetLunarHolDay()
        {
            int year = this.m_Date.Year;
            if ((year >= 0x76d) && (year <= 0x802))
            {
                int num2;
                int month = this.m_Date.Month;
                int day = this.m_Date.Day;
                byte num = this.gLunarHolDay[(((year - 0x76d) * 12) + month) - 1];
                if (day < 15)
                {
                    num2 = 15 - ((num >> 4) & 15);
                }
                else
                {
                    num2 = (num & 15) + 15;
                }
                if (day == num2)
                {
                    if (day > 15)
                    {
                        return (((month - 1) * 2) + 1);
                    }
                    return ((month - 1) * 2);
                }
            }
            return -1;
        }

        public uint LunarMonthDays(ushort iLunarYear, ushort iLunarMonth)
        {
            if ((iLunarYear < 0x76d) || (iLunarYear > 0x802))
            {
                return 30;
            }
            int num = 0;
            int num2 = 0x1d;
            int num3 = 0x10 - iLunarMonth;
            if ((iLunarMonth > this.GetLeapMonth(iLunarYear)) && (this.GetLeapMonth(iLunarYear) > 0))
            {
                num3--;
            }
            if ((this.gLunarMonthDay[iLunarYear - 0x76d] & (((int) 1) << num3)) > 0)
            {
                num2++;
            }
            if (iLunarMonth == this.GetLeapMonth(iLunarYear))
            {
                if ((this.gLunarMonthDay[iLunarYear - 0x76d] & (((int) 1) << (num3 - 1))) > 0)
                {
                    num = 30;
                }
                else
                {
                    num = 0x1d;
                }
            }
            return (uint) (num2 | (num << 0x10));
        }

        public int LunarYearDays(ushort iLunarYear)
        {
            if ((iLunarYear < 0x76d) || (iLunarYear > 0x802))
            {
                return 0;
            }
            int num = 0;
            for (ushort i = 1; i <= 12; i = (ushort) (i + 1))
            {
                uint num2 = this.LunarMonthDays(iLunarYear, i);
                num += ((ushort) (num2 >> 0x10)) & 0xffff;
                num += (ushort) num2;
            }
            return num;
        }

        public DateTime Date
        {
            get
            {
                return this.m_Date;
            }
            set
            {
                this.m_Date = value;
            }
        }
    }
}

